package org.ccay.core.base;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
 * 批量操作VO	
 * 
 * @since 2012-2-2
 */
public final class BatchVO<T> implements Serializable {
 
	private static final long serialVersionUID = 5628127817523457773L;
	/**
	 * 待创建Items
	 */
	private List<T> items2Create = new ArrayList<T>();
	/**
	 * 待删除Items
	 */
	private List<T> items2Delete = new ArrayList<T>();
	/**
	 * 待更新Items
	 */
	private List<T> items2Update = new ArrayList<T>();
	
	/**
	 * 添加与更新的并集
	 * @return
	 */
	public List<T> getCreateAndUpdateUnion(){
		List<T> union = new ArrayList<T>(items2Create);
		union.addAll(items2Update);
		return union;
	}
	
	/**
	 * 更新与删除的并集
	 * @return
	 */
	public List<T> getUpdateAndDeleteUnion(){
		List<T> union = new ArrayList<T>(items2Update);
		union.addAll(items2Delete);
		return union;
	}
	
	/**
	 * @return the items2Update
	 */
	public List<T> getItems2Update() {
		return items2Update;
	}
	/**
	 * @param items2Update the items2Update to set
	 */
	public void setItems2Update(List<T> items2Update) {
		this.items2Update = items2Update;
	}
	/**
	 * @return the items2Create
	 */
	public List<T> getItems2Create() {
		return items2Create;
	}
	/**
	 * @param items2Create the items2Create to set
	 */
	public void setItems2Create(List<T> items2Create) {
		this.items2Create = items2Create;
	}
	/**
	 * @return the items2Delete
	 */
	public List<T> getItems2Delete() {
		return items2Delete;
	}
	/**
	 * @param items2Delete the items2Delete to set
	 */
	public void setItems2Delete(List<T> items2Delete) {
		this.items2Delete = items2Delete;
	}

}
